/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	RenderView.h
*
*	Description -	Behaves like a container to contain render stage entries.
*
*	Comments	-	
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	10/08/2012	-	Creation of this file
*			MrCodeSushi	-	06/06/2013	-	Changed storage from stack to Array. The order of insert now follows the order of execution
**************************************************************************************/
#ifndef _PSX_RENDER_STAGE_MANAGER_H_
#define _PSX_RENDER_STAGE_MANAGER_H_

#include "PulseSTD.h"
#include "RenderEntry.h"
#include "GraphicsTypes.h"
#include "LightManager.h"
#include "Array.h"

namespace Pulse
{
	class RenderView
	{
	public:

		RenderView( ComponentCamera *pCamera );
		
		~RenderView( void );

		LightManager * GetLightManager( void ) { return &m_lights; }
		
		void AddLight( const ComponentLight *pLight ) { m_lights.AddLight( pLight ); }

		void AddRenderEntry( RenderEntry *pEntry );

		void ExecuteRenderStages( GraphicsPipeline *pPipeline );

		ComponentCamera * const GetCamera( void ) { return m_pCamera; }

	private:

		RenderView( const RenderView & ); // No-op

		RenderView & operator = ( const RenderView &rhs ); // No-op

	private:

		typedef Array<RenderEntry*> RenderEntryList;

		struct RenderStage
		{
			RenderEntryList m_renderteps[ERenderViewStageStep::EnumCount];
		};

		ComponentCamera	* const m_pCamera;
		LightManager	m_lights;
		RenderStage		m_renderStages[ERenderViewStage::EnumCount];

	};
}

#endif /* _PSX_RENDER_STAGE_MANAGER_H_ */
